package com.bicon.botu.account.api;

import com.bicon.botu.account.service.IAccountLogService;
import com.bicon.botu.core.base.common.controller.BaseController;
import com.bicon.botu.core.base.common.entity.BaseResult;
import com.bicon.botu.core.base.common.utils.StringUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 账户登录日志
 *
 * @author liushujie
 * @date 2018/1/4 13:53
 */
@Slf4j
@RestController
@RequestMapping("/V2.0.0/static/accountLog")
public class AccountLogApi extends BaseController {

    @Autowired
    IAccountLogService iAccountLogService;

    /**
     * 保存账户日志
     *
     * @return
     */
    @RequestMapping(value = "/saveAccountLog", method = RequestMethod.POST)
    public BaseResult saveAccountLog(@RequestParam String userId, @RequestParam String type) {
        if (StringUtils.isAnyBlank(userId, type)) {
            return sendResult400();
        }
        iAccountLogService.saveAccountLog(userId, type);
        return sendResult200();
    }
}
